Now we have to use the boundary we set up at the beginning to let the player know when the game is over.

  • Add a third if block into your event.
  • Test whether color is the same as the color of your boundary line.
  • Use Text to display a message like "Game Over!" or "You Loose!"
  • Use another Text command to display the final score.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)